var PrepareOpera = function()
{
	var opera = {
		installed: false,
		command: '',
		iniPath: ''
	};
		
	try
	{
		opera.command = WshShell.RegRead('HKEY_CLASSES_ROOT\\Applications\\Opera.exe\\shell\\open\\command');
		opera.installed = true;
	}
	catch(e)
	{
		
	}
	
	opera.iniPath = WshShell.ExpandEnvironmentStrings('%appdata%\\Opera\\Opera\\profile\\opera6.ini');
	
	return(opera);
}

var InstallInOpera = function()
{
	if (opera.installed)
	{
		opera.ini = new INI(opera.iniPath);
		if (opera.ini.getEntrySetting('State', 'Run') !== '1')
		{
			opera.ini.setEntrySetting('User Prefs', 'User JavaScript', '1');
			opera.ini.setEntrySetting('User Prefs', 'Always Load User JavaScript', '1');
			
			opera.ini.userJavaScriptFilePath = opera.ini.getEntrySetting('User Prefs', 'User JavaScript File');
			
			if (opera.ini.userJavaScriptFilePath === null || !WshFSO.FolderExists(opera.ini.userJavaScriptFilePath) || WshFSO.FileExists(opera.ini.userJavaScriptFilePath))
			{
				opera.ini.userJavaScriptFilePath = WshFSO.BuildPath(WshFSO.GetParentFolderName(opera.iniPath), 'scripts');
			}
			
			if (!WshFSO.FolderExists(opera.ini.userJavaScriptFilePath))
			{
				if (WshFSO.FileExists(opera.ini.userJavaScriptFilePath))
				{
					alert('file');
				}
				else
				{
					WshFSO.CreateFolder(opera.ini.userJavaScriptFilePath);
				}
			}
			
			opera.ini.setEntrySetting('User Prefs', 'User JavaScript File', opera.ini.userJavaScriptFilePath);
			
			opera.ini.write();
		}
		else
		{
			alert('run');
		}
		
		AppendContent(opera.ini.getEntrySetting('User Prefs', 'User JavaScript') + '<br />');
		AppendContent(opera.ini.getEntrySetting('User Prefs', 'Always Load User JavaScript') + '<br />');
		AppendContent(opera.ini.getEntrySetting('User Prefs', 'User JavaScript File') + '<br />');
	}
	
}

var PrepareFirefox = function()
{
	var firefox = {
		installed: false,
		command: ''
	}
	
	try
	{
		firefox.command = WshShell.RegRead('HKEY_CLASSES_ROOT\\Applications\\firefox.exe\\shell\\open\\command\\');
		firefox.installed = true;
	}
	catch(e)
	{
		
	}
	
	return(firefox);
}